home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / protocol / standard / scsi / scsi1_do.4 / text0000.txt < prev   
Encoding:
Text File  |  1993-07-14  |  107.5 KB  |  1,951 lines

  1.  
  2.  
  3. .fo Section 8                            #
  4. 8. Command Descriptions for Direct-Access Devices
  5.  
  6. 8.1 Group 0 Commands for Direct-Access Devices.  The Group 0 commands for 
  7. direct-access devices shall be as shown in Table 8-1.
  8.  
  9.                                   Table 8-1
  10.                   Group 0 Commands for Direct-Access Devices
  11.  
  12. ==============================================================================
  13. Operation
  14.   Code      Type   Command Name                       Section
  15. ------------------------------------------------------------------------------
  16.    00H       O     TEST UNIT READY                    7.1.1
  17.    01H       O     REZERO UNIT                        8.1.1
  18.    02H       V
  19.    03H       M     REQUEST SENSE                      7.1.2
  20.    04H       M     FORMAT UNIT                        8.1.2
  21.    05H       V
  22.    06H       V
  23.    07H       O     REASSIGN BLOCKS                    8.1.3
  24.    08H       M     READ                               8.1.4
  25.    09H       V
  26.    0AH       M     WRITE                              8.1.5
  27.    0BH       O     SEEK                               8.1.6
  28.    0CH       V
  29.    0DH       V
  30.    0EH       V
  31.    0FH       V
  32.    10H       V
  33.    11H       V
  34.    12H       E     INQUIRY                            7.1.3
  35.    13H       V
  36.    14H       V
  37.    15H       O     MODE SELECT                        8.1.7
  38.    16H       O     RESERVE                            8.1.8
  39.    17H       O     RELEASE                            8.1.9
  40.    18H       O     COPY                               7.1.4
  41.    19H       V
  42.    1AH       O     MODE SENSE                         8.1.10
  43.    1BH       O     START/STOP UNIT                    8.1.11
  44.    1CH       O     RECEIVE DIAGNOSTIC RESULTS         7.1.5
  45.    1DH       O     SEND DIAGNOSTIC                    7.1.6
  46.    1EH       O     PREVENT/ALLOW MEDIUM REMOVAL       8.1.12
  47.    1FH       R
  48. ==============================================================================
  49.  
  50. Key: M  =  Command implementation is mandatory.
  51.      E  =  Command implementation is required for SCSI devices that support 
  52.            device-independent self-configuring software.
  53.      O  =  Command implementation is optional.
  54.      R  =  Operation code is reserved for future standardization.
  55.      V  =  Operation code is available for vendor unique commands.
  56. .pa
  57.  
  58.   8.1.1 REZERO UNIT Command
  59.  
  60.      Peripheral Device Type:  Direct Access
  61.         Operation Code Type:  Optional
  62.              Operation Code:  01H
  63.  
  64.                                   Table 8-2
  65.                              REZERO UNIT Command
  66.  
  67. ==============================================================================
  68.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  69. Byte |        |        |        |        |        |        |        |        |
  70. ==============================================================================
  71.  0   |                           Operation Code                              | 
  72. -----|-----------------------------------------------------------------------|
  73.  1   | Logical Unit Number      |                  Reserved                  |
  74. -----|-----------------------------------------------------------------------|
  75.  2   |                           Reserved                                    |
  76. -----|-----------------------------------------------------------------------|
  77.  3   |                           Reserved                                    |
  78. -----|-----------------------------------------------------------------------|
  79.  4   |                           Reserved                                    |
  80. -----|-----------------------------------------------------------------------|
  81.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  82. ==============================================================================
  83.  
  84.   The REZERO UNIT command (Table 8-2) requests that the target set the logical 
  85. unit to a specific state.  See vendor specifications for details.
  86.  
  87.   8.1.2 FORMAT UNIT Command
  88.  
  89.      Peripheral Device Type:  Direct Access
  90.         Operation Code Type:  Mandatory
  91.              Operation Code:  04H
  92.  
  93.                                   Table 8-3
  94.                              FORMAT UNIT Command
  95.  
  96. ==============================================================================
  97.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  98. Byte |        |        |        |        |        |        |        |        |
  99. ==============================================================================
  100.  0   |                           Operation Code                              | 
  101. -----|-----------------------------------------------------------------------|
  102.  1   | Logical Unit Number      | FmtData| CmpLst |   Defect List Format     |
  103. -----|-----------------------------------------------------------------------|
  104.  2   |                           Vendor Unique                               |
  105. -----|-----------------------------------------------------------------------|
  106.  3   |                           Interleave (MSB)                            |
  107. -----|-----------------------------------------------------------------------|
  108.  4   |                           Interleave (LSB)                            |
  109. -----|-----------------------------------------------------------------------|
  110.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  111. ==============================================================================
  112. .pa
  113.  
  114.   The FORMAT UNIT command (Table 8-3) ensures that the medium is formatted so 
  115. that all data blocks can be accessed.  There is no guarantee that the medium 
  116. has or has not been altered.  In addition, the medium may be certified and 
  117. control structures be created for the management of the medium and defects.
  118.  
  119.   The FORMAT UNIT command is both a mandatory command and an extended command 
  120. with multiple options (see Table 8-4).
  121.  
  122.   The FORMAT UNIT command shall be rejected with RESERVATION CONFLICT status 
  123. if any extent (see 8.1.8.2) in the specified logical unit is reserved.
  124.  
  125.   A format data (FmtData) bit of one indicates that format data is supplied 
  126. during the DATA OUT phase.  The defect list included with this data specifies 
  127. the defects that shall be entered into the defect map.  The format of the 
  128. defect list is determined by defect list format.  A FmtData bit of zero 
  129. indicates that the DATA OUT phase shall not occur (no defect data shall be 
  130. supplied by the initiator).
  131.  
  132.   A complete list (CmpLst) bit of one indicates the data supplied is the 
  133. complete list of known defects.  Any previous initiator-specified defect map 
  134. or defect data shall be erased.  The target may add to this list as it formats 
  135. the medium.  The result is to purge any previous initiator-specified defect 
  136. list and to build a new defect list.  A CmpLst bit of zero indicates that the 
  137. data supplied is in addition to existing defect data using the current format.  
  138. When using the block format, the defect list refers to the current block 
  139. length (and not to the new block length, if it is different) and the defect 
  140. list refers to current logical block addresses (not physical addresses).  The 
  141. target may add to this list as it formats the medium.
  142.  
  143.   The defect list format field specifies additional information related to the 
  144. defect list.  (See Table 8-4 for further information.)
  145.  
  146.   The interleave field requests that the logical blocks be related in a 
  147. specific fashion to the physical blocks to facilitate speed matching.  An 
  148. interleave value of zero requests that the target use its default interleave.  
  149. An interleave value of one requests that consecutive logical blocks be placed 
  150. in consecutive physical order.  Values of two or greater are vendor unique.
  151. .pa
  152.  
  153.                                   Table 8-4
  154.                         FORMAT UNIT Command Variations
  155.  
  156. ==============================================================================
  157.     Bit Reference
  158. ---------------------
  159. 4    3    2    1    0
  160. FmtData
  161. |    CmpLst
  162. |    |    Defect List
  163. |    |      Format
  164. |    |    |    |    |    Command Type   Comments
  165. ---------------------    ------------   --------------------------------------
  166. 0    X    X    X    X    Mandatory      Format with no defect data sent from 
  167.                                         the initiator to the target.
  168.  
  169. 1    0    0    X    X    Extended       Format adding the defects specified in 
  170.                                         the defect list to the known defects.  
  171.                                         (See Table 8-5.)
  172.  
  173. 1    1    0    X    X    Optional       Format using defects in the defect 
  174.                                         list as the full set of known defects.  
  175.                                         (See Table 8-5.)
  176.  
  177. 1    0    1    0    0    Optional       Format adding the defects in the 
  178.                                         defect list to the known defects.  
  179.                                         (See Table 8-6.)
  180.  
  181. 1    1    1    0    0    Optional       Format using the defects in the defect 
  182.                                         list as the full set of known defects.  
  183.                                         (See Table 8-6.)
  184.  
  185. 1    0    1    0    1    Optional       Format adding the defects in the 
  186.                                         defect list to the known defects.  
  187.                                         (See Table 8-7.)
  188.  
  189. 1    1    1    0    1    Optional       Format using the defects in the defect 
  190.                                         list as the full set of known defects.  
  191.                                         (See Table 8-7.)
  192.  
  193. 1    X    1    1    0    Vendor unique
  194.  
  195. 1    0    1    1    1    Reserved
  196.  
  197. 1    1    1    1    1    Reserved
  198. ==============================================================================
  199.  
  200. X = 1 or 0 (i.e., don't care term).
  201. .pa
  202.  
  203.   The defect lists shown in Tables 8-5, 8-6, and 8-7 contain a four-byte 
  204. header followed by one or more defect descriptors.  The length of the defect 
  205. descriptors vary with the format of the defect list.
  206.  
  207.   The defect list length in each table specifies the total length in bytes of 
  208. the defect descriptors that follow.  In Table 8-5, the defect list length is 
  209. equal to four times the number of defect descriptors.  In Tables 8-6 and 8-7, 
  210. the defect list length is equal to eight times the number of defect 
  211. descriptors.
  212.  
  213.                                   Table 8-5
  214.                           Defect List - Block Format
  215.  
  216. ==============================================================================
  217. Byte |                        Defect List Header                             |
  218. ==============================================================================
  219.  0   |                           Reserved                                    |
  220. -----|-----------------------------------------------------------------------|
  221.  1   |                           Reserved                                    |
  222. -----|-----------------------------------------------------------------------|
  223.  2   |                           Defect List Length (MSB)                    |
  224. -----|-----------------------------------------------------------------------|
  225.  3   |                           Defect List Length (LSB)                    |
  226. ==============================================================================
  227.      |                        Defect Descriptor(s)                           |
  228. ==============================================================================
  229.  0   |                           Defect Block Address (MSB)                  |
  230. -----|-----------------------------------------------------------------------|
  231.  1   |                           Defect Block Address                        |
  232. -----|-----------------------------------------------------------------------|
  233.  2   |                           Defect Block Address                        |
  234. -----|-----------------------------------------------------------------------|
  235.  3   |                           Defect Block Address (LSB)                  |
  236. ==============================================================================
  237.  
  238.   Each defect descriptor for the block format specifies a four-byte defect 
  239. block address that contains the defect.  The defect descriptors shall be in 
  240. ascending order.
  241. .pa
  242.  
  243.                                   Table 8-6
  244.                     Defect List - Bytes From Index Format
  245.  
  246. ==============================================================================
  247. Byte |                        Defect List Header                             |
  248. ==============================================================================
  249.  0   |                           Reserved                                    |
  250. -----|-----------------------------------------------------------------------|
  251.  1   |                           Reserved                                    |
  252. -----|-----------------------------------------------------------------------|
  253.  2   |                           Defect List Length (MSB)                    |
  254. -----|-----------------------------------------------------------------------|
  255.  3   |                           Defect List Length (LSB)                    |
  256. ==============================================================================
  257.      |                        Defect Descriptor(s)                           |
  258. ==============================================================================
  259.  0   |                           Cylinder Number of Defect (MSB)             |
  260. -----|-----------------------------------------------------------------------|
  261.  1   |                           Cylinder Number of Defect                   |
  262. -----|-----------------------------------------------------------------------|
  263.  2   |                           Cylinder Number of Defect (LSB)             |
  264. -----|-----------------------------------------------------------------------|
  265.  3   |                           Head Number of Defect                       |
  266. -----|-----------------------------------------------------------------------|
  267.  4   |                           Defect Bytes from Index (MSB)               |
  268. -----|-----------------------------------------------------------------------|
  269.  5   |                           Defect Bytes from Index                     |
  270. -----|-----------------------------------------------------------------------|
  271.  6   |                           Defect Bytes from Index                     |
  272. -----|-----------------------------------------------------------------------|
  273.  7   |                           Defect Bytes from Index (LSB)               |
  274. ==============================================================================
  275.  
  276.   Each defect descriptor for the bytes from index format specifies the 
  277. beginning of an eight-byte defect location on the medium.  Each defect 
  278. descriptor is comprised of the cylinder number of defect, the head number of 
  279. defect, and the defect bytes from index.  The defect descriptors shall be in 
  280. ascending order.  For determining ascending order, the cylinder number of 
  281. defect is considered the most significant part of the address and the defect 
  282. bytes from index is considered the least significant part of the address.
  283.  
  284.   A defect bytes from index of FFFFFFFFH indicates that the entire track shall 
  285. be reassigned.
  286. .pa
  287.  
  288.                                   Table 8-7
  289.                      Defect List - Physical Sector Format
  290.  
  291. ==============================================================================
  292. Byte |                        Defect List Header                             |
  293. ==============================================================================
  294.  0   |                           Reserved                                    |
  295. -----|-----------------------------------------------------------------------|
  296.  1   |                           Reserved                                    |
  297. -----|-----------------------------------------------------------------------|
  298.  2   |                           Defect List Length (MSB)                    |
  299. -----|-----------------------------------------------------------------------|
  300.  3   |                           Defect List Length (LSB)                    |
  301. ==============================================================================
  302.      |                        Defect Descriptor(s)                           |
  303. ==============================================================================
  304.  0   |                           Cylinder Number of Defect (MSB)             |
  305. -----|-----------------------------------------------------------------------|
  306.  1   |                           Cylinder Number of Defect                   |
  307. -----|-----------------------------------------------------------------------|
  308.  2   |                           Cylinder Number of Defect (LSB)             |
  309. -----|-----------------------------------------------------------------------|
  310.  3   |                           Head Number of Defect                       |
  311. -----|-----------------------------------------------------------------------|
  312.  4   |                           Defect Sector Number (MSB)                  |
  313. -----|-----------------------------------------------------------------------|
  314.  5   |                           Defect Sector Number                        |
  315. -----|-----------------------------------------------------------------------|
  316.  6   |                           Defect Sector Number                        |
  317. -----|-----------------------------------------------------------------------|
  318.  7   |                           Defect Sector Number (LSB)                  |
  319. ==============================================================================
  320.  
  321.   Each defect descriptor for the physical sector format specifies a sector-
  322. size defect location comprised of the cylinder number of defect, the head 
  323. number of defect, and the defect sector number.  The defect descriptors shall 
  324. be in ascending order.  For determining ascending order, the cylinder number 
  325. of defect is considered the most significant part of the address and the 
  326. defect sector number is considered the least significant part of the address.
  327.  
  328.   A defect sector number of FFFFFFFFH indicates that the entire track shall be 
  329. reassigned.
  330. .pa
  331.  
  332.   8.1.3 REASSIGN BLOCKS Command
  333.  
  334.      Peripheral Device Type:  Direct Access and Write-Once Read-Multiple
  335.         Operation Code Type:  Optional
  336.              Operation Code:  07H
  337.  
  338.                                   Table 8-8
  339.                            REASSIGN BLOCKS Command
  340.  
  341. ==============================================================================
  342.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  343. Byte |        |        |        |        |        |        |        |        |
  344. ==============================================================================
  345.  0   |                           Operation Code                              | 
  346. -----|-----------------------------------------------------------------------|
  347.  1   | Logical Unit Number      |                  Reserved                  |
  348. -----|-----------------------------------------------------------------------|
  349.  2   |                           Reserved                                    |
  350. -----|-----------------------------------------------------------------------|
  351.  3   |                           Reserved                                    |
  352. -----|-----------------------------------------------------------------------|
  353.  4   |                           Reserved                                    |
  354. -----|-----------------------------------------------------------------------|
  355.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  356. ==============================================================================
  357.  
  358.   The REASSIGN BLOCKS command (Table 8-8) requests the target to reassign the 
  359. defective logical blocks to an area on the logical unit reserved for this 
  360. purpose.
  361.  
  362.   The initiator transfers a defect list that contains the logical block 
  363. addresses to be reassigned.  The target shall reassign the physical medium 
  364. used for each logical block address in the list.  The data contained in the 
  365. logical blocks specified in the defect list may be altered, but the data in 
  366. all other logical blocks on the medium shall be preserved.
  367.  
  368.   The effect of specifying a logical block to be reassigned that previously 
  369. has been reassigned is to reassign the block again.  Thus, over the life of 
  370. the medium, a logical block can be assign to multiple physical addresses 
  371. (until no more spare locations remain on the medium).
  372.  
  373.   The REASSIGN BLOCKS defect list (Table 8-9) contains a four-byte header 
  374. followed by one or more defect descriptors.  The length of each defect 
  375. descriptor is four bytes.
  376.  
  377.   The defect list length specifies the total length in bytes of the defect 
  378. descriptors that follow.  The defect list length is equal to four times the 
  379. number of defect descriptors.
  380. .pa
  381.  
  382.                                   Table 8-9
  383.                          REASSIGN BLOCKS Defect List
  384.  
  385. ==============================================================================
  386. Byte |                        Defect List Header                             |
  387. ==============================================================================
  388.  0   |                           Reserved                                    |
  389. -----|-----------------------------------------------------------------------|
  390.  1   |                           Reserved                                    |
  391. -----|-----------------------------------------------------------------------|
  392.  2   |                           Defect List Length (MSB)                    |
  393. -----|-----------------------------------------------------------------------|
  394.  3   |                           Defect List Length (LSB)                    |
  395. ==============================================================================
  396.      |                        Defect Descriptor(s)                           |
  397. ==============================================================================
  398.  0   |                           Defect Logical Block Address (MSB)          |
  399. -----|-----------------------------------------------------------------------|
  400.  1   |                           Defect Logical Block Address                |
  401. -----|-----------------------------------------------------------------------|
  402.  2   |                           Defect Logical Block Address                |
  403. -----|-----------------------------------------------------------------------|
  404.  3   |                           Defect Logical Block Address (LSB)          |
  405. ==============================================================================
  406.  
  407.   The defect descriptor specifies a four-byte defect logical block address 
  408. that contains the defect.  The defect descriptors shall be in ascending order.
  409.  
  410.   If the logical unit has insufficient capacity to reassign all of the 
  411. defective logical blocks, the command shall terminate with a CHECK CONDITION 
  412. status and the sense key shall be set to MEDIUM ERROR.  The logical block 
  413. address of the first logical block not reassigned shall be returned in the 
  414. information bytes of the sense data.
  415. .pa
  416.  
  417.   8.1.4 READ Command
  418.  
  419.      Peripheral Device Type:  Direct Access
  420.         Operation Code Type:  Mandatory
  421.              Operation Code:  08H
  422.  
  423.                                   Table 8-10
  424.                                  READ Command
  425.  
  426. ==============================================================================
  427.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  428. Byte |        |        |        |        |        |        |        |        |
  429. ==============================================================================
  430.  0   |                           Operation Code                              | 
  431. -----|-----------------------------------------------------------------------|
  432.  1   | Logical Unit Number      |Logical Block Address (MSB)                 |
  433. -----|-----------------------------------------------------------------------|
  434.  2   |                           Logical Block Address                       |
  435. -----|-----------------------------------------------------------------------|
  436.  3   |                           Logical Block Address (LSB)                 |
  437. -----|-----------------------------------------------------------------------|
  438.  4   |                           Transfer Length                             |
  439. -----|-----------------------------------------------------------------------|
  440.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  441. ==============================================================================
  442.  
  443.   The READ command (Table 8-10) requests that the target transfer data to the 
  444. initiator.
  445.  
  446.   The logical block address specifies the logical block at which the read 
  447. operation shall begin.
  448.  
  449.   The transfer length specifies the number of contiguous logical blocks of 
  450. data to transferred.  A transfer length of zero indicates that 256 logical 
  451. blocks shall be transferred.  Any other value indicates the number of logical 
  452. blocks that shall be transferred.
  453.  
  454.   The most recent data value written in the addressed logical block shall be 
  455. returned.
  456.  
  457.   This command shall be terminated with a RESERVATION CONFLICT status if any 
  458. reservation access conflict (see 8.1.8) exists and no data shall be read.
  459.  
  460.   If any of the following conditions occur, this command shall be terminated 
  461. with a CHECK CONDITION status, and if extended sense is implemented, the sense 
  462. key shall be set as indicated in the following table.  This table does not 
  463. provide an exhaustive enumeration of all conditions that may cause the CHECK 
  464. CONDITION status.
  465. .pa
  466.  
  467. Condition                                         Sense Key
  468. ----------------------------------------------    ----------------------------
  469. Invalid logical block address                     ILLEGAL REQUEST (see note)
  470.  
  471. Target reset or medium change since
  472. last command from this initiator                  UNIT ATTENTION
  473.  
  474. Unrecoverable read error                          MEDIUM ERROR
  475.  
  476. Recovered read error                              RECOVERED ERROR
  477.  
  478. Overrun or other error that might
  479. be resolved by repeating the command              ABORTED COMMAND
  480.  
  481. NOTE:  The extended sense information bytes shall be set to the logical block 
  482. address of the first invalid address.
  483.  
  484.   8.1.5 WRITE Command
  485.  
  486.      Peripheral Device Type:  Direct Access
  487.         Operation Code Type:  Mandatory
  488.              Operation Code:  0AH
  489.  
  490.                                   Table 8-11
  491.                                 WRITE Command
  492.  
  493. ==============================================================================
  494.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  495. Byte |        |        |        |        |        |        |        |        |
  496. ==============================================================================
  497.  0   |                           Operation Code                              | 
  498. -----|-----------------------------------------------------------------------|
  499.  1   | Logical Unit Number      |Logical Block Address (MSB)                 |
  500. -----|-----------------------------------------------------------------------|
  501.  2   |                           Logical Block Address                       |
  502. -----|-----------------------------------------------------------------------|
  503.  3   |                           Logical Block Address (LSB)                 |
  504. -----|-----------------------------------------------------------------------|
  505.  4   |                           Transfer Length                             |
  506. -----|-----------------------------------------------------------------------|
  507.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  508. ==============================================================================
  509.  
  510.   The WRITE command (Table 8-11) requests that the target write the data 
  511. transferred by the initiator to the medium.
  512.  
  513.   The logical block address specifies the logical block at which the write 
  514. operation shall begin.
  515.  
  516.   The transfer length specifies the number of contiguous logical blocks of 
  517. data to transferred.  A transfer length of zero indicates that 256 logical 
  518. blocks shall be transferred.  Any other value indicates the number of logical 
  519. blocks that shall be transferred.
  520. .pa
  521.  
  522.   This command shall be terminated with a RESERVATION CONFLICT status if any 
  523. reservation access conflict (see 8.1.8) exists and no data shall be written.
  524.  
  525.   If any of the following conditions occur, this command shall be terminated 
  526. with a CHECK CONDITION status, and if extended sense is implemented, the sense 
  527. key shall be set as indicated in the following table.  This table does not 
  528. provide an exhaustive enumeration of all conditions that may cause the CHECK 
  529. CONDITION status.
  530.  
  531. Condition                                         Sense Key
  532. ----------------------------------------------    ----------------------------
  533. Invalid logical block address                     ILLEGAL REQUEST (see note)
  534.  
  535. Target reset or medium change since
  536. last command from this initiator                  UNIT ATTENTION
  537.  
  538. Overrun or other error that might
  539. be resolved by repeating the command              ABORTED COMMAND
  540.  
  541. NOTE:  The extended sense information bytes shall be set to the logical block 
  542. address of the first invalid address.  In this case, no data shall be 
  543. written on the logical unit.
  544.  
  545.   8.1.6 SEEK Command
  546.  
  547.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  548.                               Read-Only Direct Access
  549.         Operation Code Type:  Optional
  550.              Operation Code:  0BH
  551.  
  552.                                   Table 8-12
  553.                                  SEEK Command
  554.  
  555. ==============================================================================
  556.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  557. Byte |        |        |        |        |        |        |        |        |
  558. ==============================================================================
  559.  0   |                           Operation Code                              | 
  560. -----|-----------------------------------------------------------------------|
  561.  1   | Logical Unit Number      |Logical Block Address (MSB)                 |
  562. -----|-----------------------------------------------------------------------|
  563.  2   |                           Logical Block Address                       |
  564. -----|-----------------------------------------------------------------------|
  565.  3   |                           Logical Block Address (LSB)                 |
  566. -----|-----------------------------------------------------------------------|
  567.  4   |                           Reserved                                    |
  568. -----|-----------------------------------------------------------------------|
  569.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  570. ==============================================================================
  571.  
  572.   The SEEK command (Table 8-12) requests that the logical unit seek to the 
  573. specified logical block address.
  574. .pa
  575.  
  576.   8.1.7 MODE SELECT Command
  577.  
  578.      Peripheral Device Type:  Direct Access
  579.         Operation Code Type:  Optional
  580.              Operation Code:  15H
  581.  
  582.                                   Table 8-13
  583.                              MODE SELECT Command
  584.  
  585. ==============================================================================
  586.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  587. Byte |        |        |        |        |        |        |        |        |
  588. ==============================================================================
  589.  0   |                           Operation Code                              | 
  590. -----|-----------------------------------------------------------------------|
  591.  1   | Logical Unit Number      |                  Reserved                  |
  592. -----|-----------------------------------------------------------------------|
  593.  2   |                           Reserved                                    |
  594. -----|-----------------------------------------------------------------------|
  595.  3   |                           Reserved                                    |
  596. -----|-----------------------------------------------------------------------|
  597.  4   |                           Parameter List Length                       |
  598. -----|-----------------------------------------------------------------------|
  599.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  600. ==============================================================================
  601.  
  602.   The MODE SELECT command (Table 8-13) provides a means for the initiator to 
  603. specify medium, logical unit, or peripheral device parameters to the target.
  604.  
  605.   The  parameter list length specifies the length in bytes of the MODE SELECT 
  606. parameter list that shall be transferred during the DATA OUT phase.  A 
  607. parameter list length of zero indicates that no data shall be transferred.  
  608. This condition shall not be considered as an error.
  609.  
  610.   The MODE SELECT parameter list (Table 8-14) contains a four-byte header, 
  611. followed by zero or more block descriptors, followed by the vendor unique 
  612. parameters, if any.
  613. .pa
  614.  
  615.                                   Table 8-14
  616.                           MODE SELECT Parameter List
  617.  
  618. ==============================================================================
  619. Byte |                        MODE SELECT Header                             |
  620. ==============================================================================
  621.  0   |                           Reserved                                    |
  622. -----|-----------------------------------------------------------------------|
  623.  1   |                           Medium Type                                 |
  624. -----|-----------------------------------------------------------------------|
  625.  2   |                           Reserved                                    |
  626. -----|-----------------------------------------------------------------------|
  627.  3   |                           Block Descriptor Length                     |
  628. ==============================================================================
  629.      |                        Block  Descriptor(s)                           |
  630. ==============================================================================
  631.  0   |                           Density Code                                |
  632. -----|-----------------------------------------------------------------------|
  633.  1   |                           Number of Blocks (MSB)                      |
  634. -----|-----------------------------------------------------------------------|
  635.  2   |                           Number of Blocks                            |
  636. -----|-----------------------------------------------------------------------|
  637.  3   |                           Number of Blocks (LSB)                      |
  638. -----|-----------------------------------------------------------------------|
  639.  4   |                           Reserved                                    |
  640. -----|-----------------------------------------------------------------------|
  641.  5   |                           Block Length (MSB)                          |
  642. -----|-----------------------------------------------------------------------|
  643.  6   |                           Block Length                                |
  644. -----|-----------------------------------------------------------------------|
  645.  7   |                           Block Length (LSB)                          |
  646. ==============================================================================
  647.      |                        Vendor Unique Parameter(s)                     |
  648. ==============================================================================
  649. 0 _ n|                           Vendor Unique                               |
  650.      |                           Parameter Byte(s)                           |
  651. ==============================================================================
  652. .pa
  653.  
  654. .fo Section 8                        93.1
  655.   Code values for the medium type field are defined in Table 8-14.1.
  656.  
  657.                                  Table 8-14.1
  658.                        Direct-access Medium Type Codes
  659.  
  660. ==============================================================================
  661.   Code Value                       Medium Type
  662.   ----------  ----------------------------------------------------------------
  663.      00H      Default medium type (currently mounted medium type)
  664.      01H      Flexible disk, single-sided; unspecified medium
  665.      02H      Flexible disk, double-sided; unspecified medium
  666.          
  667.                                  Flexible Disks
  668.               Diameter    Bit Density  Track Density  Number    Reference
  669.               mm (inch)   Bits/Radian  /mm (/inch)    Of Sides  Standard
  670.               ----------  -----------  -------------  --------  --------------
  671.      05H      200 (8.0)      6 631       1.9 (48)        1      X3.73-1980
  672.      06H      200 (8.0)      6 631       1.9 (48)        2      X3B8-140
  673.      09H      200 (8.0)     13 262       1.9 (48)        1      X3B8/78-139
  674.      0AH      200 (8.0)     13 262       1.9 (48)        2      X3.121-1984
  675.      0DH      130 (5.25)     3 979       1.9 (48)        1      X3.82-1980
  676.      12H      130 (5.25)     7 958       1.9 (48)        2      X3.125-1984
  677.      16H      130 (5.25)     7 958       3.8 (96)        2      X3.126-198X
  678.      1AH      130 (5.25)    13 262       3.8 (96)        2      DIS 8630
  679.      1EH       90 (3.5)      7 958       5.3 (135)       2      X3.137-198X
  680.  
  681.                          Direct-access Magnetic Tapes
  682.               Width                Density       Reference
  683.               mm. (Inch)   Tracks  FTPMM (FTPI)  Standard     Note
  684.               -----------  ------  ------------  -----------  ----
  685.      40H       6.3 (0.25)    12    394 (10 000)  X3B5/85-138   1
  686.      44H       6.3 (0.25)    24    394 (10 000)  X3B5/85-138   1
  687.  
  688.   80H _ FFH   Vendor unique
  689.   All others  Reserved
  690. ==============================================================================
  691. NOTES:
  692.   (1)  The referenced standard is for unrecorded miniature cartridge media.  
  693. The usage referred to here is for serial GCR recording using a format known as 
  694. QIC-100.  Since X3B5 issues a new document number for each revision of their 
  695. working draft document, please contact the Chairman of X3B5 for the latest 
  696. document number.
  697.   (2)  See appendix F for additional standards that may be applicable.
  698.  
  699.  
  700.   The block descriptor length specifies the length in bytes of all the block 
  701. descriptors.  It is equal to the number of block descriptors times eight and 
  702. does not include the vendor unique parameters, if any.  A block descriptor 
  703. length of zero indicates that no block descriptors shall be included in the 
  704. parameter list.  This condition shall not be considered as an error.
  705.  
  706.   Each block descriptor specifies the medium characteristics for all or part 
  707. of a logical unit.  Each block descriptor contains a density code, a number of 
  708. blocks, and a block length.
  709. .pa
  710.  
  711. .fo Section 8                           93.2
  712.   Code values for the density code field shall be assigned as follows:
  713.  
  714.   00H         Default (default density of medium)
  715.   01H         Flexible disk, single-density
  716.   02H         Flexible disk, double-density
  717.   03H _ 7FH   Reserved
  718.   80H _ FFH   Vendor unique
  719.  
  720.   The number of blocks field specifies the number of logical blocks on the 
  721. medium that meet the density code and block length in the block descriptor.  A 
  722. number of blocks of zero indicates that all of the remaining logical blocks of 
  723. the logical unit shall have the medium characteristics specified by the block 
  724. descriptor.
  725.  
  726.   The block length specifies the length in bytes of each logical block 
  727. described by the block descriptor.
  728. .pa
  729.  
  730. .pn 94
  731. .fo Section 8                            #
  732.   8.1.8 RESERVE Command
  733.  
  734.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  735.                               Read-Only Direct Access
  736.         Operation Code Type:  Optional
  737.              Operation Code:  16H
  738.  
  739.                                   Table 8-15
  740.                                RESERVE Command
  741.  
  742. ==============================================================================
  743.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  744. Byte |        |        |        |        |        |        |        |        |
  745. ==============================================================================
  746.  0   |                           Operation Code                              | 
  747. -----|-----------------------------------------------------------------------|
  748.  1   | Logical Unit Number      | 3rdPty | Third Party Device ID    | Extent |
  749. -----|-----------------------------------------------------------------------|
  750.  2   |                           Reservation Identification                  |
  751. -----|-----------------------------------------------------------------------|
  752.  3   |                           Extent List Length (MSB)                    |
  753. -----|-----------------------------------------------------------------------|
  754.  4   |                           Extent List Length (LSB)                    |
  755. -----|-----------------------------------------------------------------------|
  756.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  757. ==============================================================================
  758.  
  759.   The RESERVE command (Table 8-15) is used to reserve logical units or, if the 
  760. extent reservation option is implemented, extents within logical units for the 
  761. use of the initiator.  If third-party reservation option is implemented, the 
  762. logical units or extents may be reserved for another specified SCSI device.  
  763. The RESERVE and RELEASE commands provide the basic mechanism for contention 
  764. resolution in multiple-initiator systems.
  765.  
  766.      8.1.8.1 Logical Unit Reservation.  If the extent bit is zero, this 
  767. command shall request that the entire logical unit be reserved for the 
  768. exclusive use of the initiator until the reservation is superceded by another 
  769. valid RESERVE command from the initiator that made the reservation or until 
  770. released by a RELEASE command from the same initiator, by a BUS DEVICE RESET 
  771. message from any initiator, or by a "hard" RESET condition.  A logical unit 
  772. reservation shall not be granted if the logical unit or any extent is reserved 
  773. by another initiator.  It shall be permissible for an initiator to reserve a 
  774. logical unit that is currently reserved by that initiator.  If the extent bit 
  775. is zero, the reservation identification and the extent list length shall be 
  776. ignored.
  777.  
  778.   If the logical unit, or any extent within the logical unit is reserved for 
  779. another initiator, the target shall respond by either:
  780.  
  781.   (1)  returning a RESERVATION CONFLICT status
  782.  
  783.   (2)  queuing the reservation request and then disconnecting until all 
  784. previously queued reservations have been released and the logical unit is 
  785. available, then reconnecting to perform the reservation
  786.  
  787.   If, after honoring the reservation, any other initiator then subsequently 
  788.  
  789. attempts to perform any command on the reserved logical unit other than a 
  790. RESERVE command, which may be queued, or a RELEASE command, which shall be 
  791. ignored, then the command shall be rejected with RESERVATION CONFLICT status. 
  792.  
  793.      8.1.8.2 Extent Reservation (Optional).  The reservation identification 
  794. provides a means for an initiator to identify each extent reservation.  This 
  795. allows an initiator in a multiple tasking environment, to have multiple 
  796. reservations outstanding.  The reservation identification is used in the 
  797. RELEASE command to specify which reservation is to be released.  It is also 
  798. used in superceding RESERVE commands to specify which reservation is to be 
  799. superceded.
  800.  
  801.   If the extent reservation option is implemented, then the extent release 
  802. option (see 8.1.9.2) shall also be implemented.  These options permit multiple 
  803. extents within the logical unit to be reserved, each with a separate 
  804. reservation type.
  805.  
  806.   If the extent bit is one, and the extent reservation option is implemented, 
  807. then the target shall process the reservation request as follows:
  808.  
  809.   (1)  The extent list shall be checked for the number of extents in the 
  810. reservation request.  If the extent list length is zero, no reservations shall 
  811. be changed and this condition shall not be treated as an error.  If the extent 
  812. list contains more extents than are supported on the logical unit, the command 
  813. shall be terminated with a CHECK CONDITION status and the sense key shall be 
  814. set to ILLEGAL REQUEST.  If the extent list contains more extents than are 
  815. currently available on the logical unit, then the target shall either:
  816.      (a)  return RESERVATION CONFLICT status 
  817.      (b)  queue the request and disconnect until sufficient extents are made 
  818.   available.  When sufficient extents are available, the target shall 
  819.   reconnect to continue processing the request.
  820.  
  821.   (2)  The extent list shall be checked for valid extent logical block 
  822. addresses.  If any logical block address is invalid for this logical unit, the 
  823. command shall be terminated with a CHECK CONDITION status and the sense key 
  824. shall be set to ILLEGAL REQUEST.  The extent list shall be checked for invalid 
  825. extent overlaps (as defined by reservation type) with other extent descriptors 
  826. in the extent list and if invalid overlaps are found, the command shall be 
  827. terminated with a CHECK CONDITION status and the sense key shall be set to 
  828. ILLEGAL REQUEST.
  829.  
  830.   (3)  If the requested reservation does not conflict with any active or 
  831. previously requested reservation, the extents specified shall be reserved 
  832. until superceded by another valid RESERVE command from the initiator that made 
  833. the reservation or until released by a RELEASE command from the same 
  834. initiator, by a BUS DEVICE RESET message from any initiator, or by a "hard" 
  835. RESET condition.  If either of the last two conditions occur, the next command 
  836. >From each initiator shall be terminated with a CHECK CONDITION status and the 
  837. sense key shall be set to UNIT ATTENTION.
  838.  
  839.   (4)  If the reservation request conflicts with a reservation already active 
  840. or a reservation request that is already queued, then the target shall either:
  841.      (a)  return RESERVATION CONFLICT status
  842.      (b)  queue the reservation and disconnect until it is allowed to be 
  843.   active.  Reservations are only made active when all extents are free from 
  844.   conflict with active or previously queued reservations.
  845.  
  846.  
  847.   If the extent bit is one, and the extent reservation option is not 
  848. implemented, then the RESERVE command shall be rejected with CHECK CONDITION 
  849. status and the sense key shall be set to ILLEGAL REQUEST.
  850.  
  851.                                   Table 8-16
  852.                       Data Format of Extent Descriptors
  853.  
  854. ==============================================================================
  855.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  856. Byte |        |        |        |        |        |        |        |        |
  857. ==============================================================================
  858.  0   |         Reserved                           | RelAdr | Reservation Type|
  859. -----|-----------------------------------------------------------------------|
  860.  1   |                           Number of Blocks (MSB)                      |
  861. -----|-----------------------------------------------------------------------|
  862.  2   |                           Number of Blocks                            |
  863. -----|-----------------------------------------------------------------------|
  864.  3   |                           Number of Blocks (LSB)                      |
  865. -----|-----------------------------------------------------------------------|
  866.  4   |                           Logical Block Address (MSB)                 |
  867. -----|-----------------------------------------------------------------------|
  868.  5   |                           Logical Block Address                       |
  869. -----|-----------------------------------------------------------------------|
  870.  6   |                           Logical Block Address                       |
  871. -----|-----------------------------------------------------------------------|
  872.  7   |                           Logical Block Address (LSB)                 |
  873. ==============================================================================
  874.  
  875.   The size of the extent list shall be defined by the extent list length 
  876. parameter.  The extent list shall consist of zero or more descriptors as shown 
  877. in Table 8-16.  Each extent descriptor defines an extent beginning at the 
  878. specified logical block address for the specified number of blocks.  If the 
  879. number of blocks is zero, the extent shall begin at the specified logical 
  880. block address and continue through the last logical block address on the 
  881. logical unit.
  882.  
  883.   The reservation type field shall determine the type of reservation to be 
  884. effected for each extent.  Four types of reservations are possible as follows:
  885.  
  886.   DB(1) DB(0)  Reservation Type
  887.   ----- -----  ----------------
  888.     1     0    Read Exclusive 
  889.     0     1    Write Exclusive
  890.     1     1    Exclusive Access
  891.     0     0    Read Shared
  892.  
  893. Read Exclusive.  While this reservation is active, no other initiator shall be 
  894. permitted read operations to the indicated extent.  This reservation shall not 
  895. inhibit write operations from any initiator or conflict with a write exclusive 
  896. reservation; however, read exclusive, exclusive access, and read shared 
  897. reservations that overlap this extent shall conflict with this reservation.
  898.  
  899. Write Exclusive.  While this reservation is active, no other initiator shall 
  900. be permitted write operations to the indicated extent.  This reservation shall 
  901. not inhibit read operations from any initiator or conflict with a read 
  902.  
  903. exclusive reservation from any initiator.  This reservation shall conflict 
  904. with write exclusive, exclusive access, and read shared reservations that 
  905. overlap this extent.
  906.  
  907. Exclusive Access.  While this reservation is active, no other initiator shall 
  908. be permitted any access to the indicated extent.  All reservation types that 
  909. overlap this extent shall conflict with this reservation.
  910.  
  911. Read Shared.  While this reservation is active, no write operations shall be 
  912. permitted by any initiator to the indicated extent.  This reservation shall 
  913. not inhibit read operations from any initiator or conflict with a read shared 
  914. reservation.  Read exclusive, write exclusive, and exclusive access 
  915. reservations that overlap with this extent shall conflict with this 
  916. reservation.
  917.  
  918.   If the relative address bit is one, the logical block address shall be 
  919. treated as a two's complement displacement.  This displacement shall be added 
  920. to the logical block address last accessed on the logical unit to form the 
  921. logical block address for this extent.  This feature is only available when 
  922. linking commands and requires that a previous command in the linked group has 
  923. accessed a logical block on the logical unit; if not, the RESERVE command 
  924. shall be terminated with a CHECK CONDITION status and the sense key shall be 
  925. set to ILLEGAL REQUEST.
  926.  
  927.   If an initiator attempts a command to a logical block that has been 
  928. reserved and that access is prohibited by the reservation, the command shall 
  929. not be performed and the command shall be terminated with a RESERVATION 
  930. CONFLICT status.  If a reservation conflict precludes any part of the command, 
  931. none of the command shall be performed.  COPY commands shall be terminated 
  932. with a CHECK CONDITION status and the sense key shall be set to DATA PROTECT 
  933. if any part of the copy operation is prohibited by an active reservation.  If 
  934. any extent in a logical unit is reserved in any way, a FORMAT UNIT command 
  935. shall be rejected with a RESERVATION CONFLICT status.
  936.  
  937.      8.1.8.3 Third Party Reservation (Optional).  The third-party reservation 
  938. option for the RESERVE command allows an initiator to reserve a logical unit 
  939. or extents within a logical unit for another SCSI device.  This option is 
  940. intended for use in multiple-initiator systems that use the COPY command.  Any 
  941. target that implements the third-party reservation option shall also implement 
  942. the third-party release option (see 8.1.9.3).
  943.  
  944.   If the third-party (3rdPty) bit is zero, then the third-party reservation 
  945. option is not requested.  If the 3rdPty bit is one and the third-party 
  946. reservation option is implemented, then the RESERVE command shall reserve the 
  947. specified logical unit or extents for the SCSI device specified in the third-
  948. party device ID field.  The target shall preserve the reservation until it is 
  949. superceded by another valid RESERVE command from the initiator that made the 
  950. reservation or until it is released by the same initiator, by a BUS DEVICE 
  951. RESET message from any initiator, or a "hard" RESET condition.  The target 
  952. shall ignore any attempt to release the reservation made by any other 
  953. initiator.
  954.  
  955.   If the 3rdPty bit is one and the third-party reservation option is not 
  956. implemented, then the target shall reject the RESERVE command with a CHECK 
  957. CONDITION status and the sense key shall be set to ILLEGAL REQUEST. 
  958.  
  959.  
  960.      8.1.8.4 Superceding Reservations.  An initiator that holds a current 
  961. reservation may modify that reservation by issuing another RESERVE command to 
  962. the same logical unit and, if the extent bit is one, using the same 
  963. reservation identification.  The superceding RESERVE command shall release the 
  964. previous reservation state when the new reservation request is granted.  The 
  965. previous reservation shall not be modified if the new reservation request 
  966. cannot be granted.  If the superceding reservation cannot be granted because 
  967. of conflicts with a previous active reservation (other than the reservation 
  968. being superceded), then the target shall either:
  969.  
  970.   (1)  return RESERVATION CONFLICT status
  971.  
  972.   (2)  queue the reservation request and disconnect until it is allowed to be 
  973. active.  The reservation request shall be made active when it is free from 
  974. conflict with all active reservations.  A superceding reservation takes 
  975. priority over any previously queued reservation request.
  976.  
  977. IMPLEMENTORS NOTE:  Superceding reservations are principally intended to allow 
  978. the SCSI device ID to be changed on a reservation using the third-party 
  979. reservation option.  This capability is necessary for certain situations when 
  980. using the COPY command.
  981.  
  982.   8.1.9 RELEASE Command
  983.  
  984.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  985.                               Read-Only Direct Access
  986.         Operation Code Type:  Optional
  987.              Operation Code:  17H
  988.  
  989.                                   Table 8-17
  990.                                RELEASE Command
  991.  
  992. ==============================================================================
  993.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  994. Byte |        |        |        |        |        |        |        |        |
  995. ==============================================================================
  996.  0   |                           Operation Code                              | 
  997. -----|-----------------------------------------------------------------------|
  998.  1   | Logical Unit Number      | 3rdPty | Third Party Device ID    | Extent |
  999. -----|-----------------------------------------------------------------------|
  1000.  2   |                           Reservation Identification                  |
  1001. -----|-----------------------------------------------------------------------|
  1002.  3   |                           Reserved                                    |
  1003. -----|-----------------------------------------------------------------------|
  1004.  4   |                           Reserved                                    |
  1005. -----|-----------------------------------------------------------------------|
  1006.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1007. ==============================================================================
  1008.  
  1009.   The RELEASE command (Table 8-17) is used to release previously reserved 
  1010. logical units, or, if the extent release option is implemented, previously 
  1011. reserved extents within logical units.  It is not an error for an initiator to 
  1012. attempt to release a reservation that is not currently active.  In this case, 
  1013. the target returns GOOD status without altering any other reservation.
  1014.  
  1015.      8.1.9.1 Logical Unit Release.  If the extent bit is zero, this command 
  1016.  
  1017. shall cause the target to terminate all logical unit and extent reservations 
  1018. that are active from the initiator to the specified logical unit.
  1019.  
  1020.      8.1.9.2 Extent Release (Optional).  If the extent bit is one and the 
  1021. extent release option is not implemented, then the RELEASE command shall be 
  1022. terminated with a CHECK CONDITION status and the sense key shall be set to 
  1023. ILLEGAL REQUEST.  This option shall be implemented if the extent reservation 
  1024. option (see 8.1.8.2) is implemented.
  1025.  
  1026.   If the extent bit is one and the extent release option is implemented, this 
  1027. command shall cause any reservation from the requesting initiator with a 
  1028. matching reservation identification to be terminated.  Other reservations from 
  1029. the requesting initiator shall remain in effect.
  1030.  
  1031.   If the logical unit queues reservations, then when a RELEASE command is 
  1032. processed, the reservation queue shall be examined on a first-in first-out 
  1033. basis.  If there are one or more reservations in the queue that can now be 
  1034. activated, the logical unit shall first disconnect from the initiator.  It 
  1035. shall then successively reconnect with each initiator whose queued reservation 
  1036. may now be activated.  A queued reservation request shall not be activated if 
  1037. it conflicts with any previously queued reservation.  After first granting all 
  1038. possible queued reservations, the unit shall reconnect with the initiator of 
  1039. the RELEASE command to terminate the command.
  1040.  
  1041.   If a logical unit that queues reservations receives a RELEASE command from a 
  1042. second initiator while it is disconnected during processing of a previous 
  1043. RELEASE command, it shall then disconnect from the second initiator and 
  1044. suspend processing of the second RELEASE until after reconnection with the 
  1045. first initiator, or until it is determined that reconnection has failed.
  1046.  
  1047.      8.1.9.3 Third Party Release (Optional).  The third-party release option 
  1048. for the RELEASE command allows an initiator to release a logical unit or 
  1049. extents within a logical unit that were previously reserved using the third-
  1050. party reservation option (see 8.1.8.3).  This option shall be implemented if 
  1051. the third-party reservation option is implemented.  This option is intended 
  1052. for use in multiple-initiator systems that use the COPY command.
  1053.  
  1054.   If the third-party (3rdPty) bit is zero, then the third-party release option 
  1055. is not requested.  If the 3rdPty bit is one and the target implements the 
  1056. third-party release option, then the target shall release the specified 
  1057. logical unit or extents, but only if the reservation was made using the third-
  1058. party reservation option by the initiator that is requesting the release for 
  1059. the same SCSI device as specified in the third-party device ID field.
  1060.  
  1061.   If the 3rdPty bit is one and the target does not implement the third-party 
  1062. release option, then the target shall terminate the command with a CHECK 
  1063. CONDITION status and the sense key shall be set to ILLEGAL REQUEST.
  1064. .pa
  1065.  
  1066.   8.1.10 MODE SENSE Command
  1067.  
  1068.      Peripheral Device Type:  Direct Access
  1069.         Operation Code Type:  Optional
  1070.              Operation Code:  1AH
  1071.  
  1072.                                   Table 8-18
  1073.                               MODE SENSE Command
  1074.  
  1075. ==============================================================================
  1076.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1077. Byte |        |        |        |        |        |        |        |        |
  1078. ==============================================================================
  1079.  0   |                           Operation Code                              | 
  1080. -----|-----------------------------------------------------------------------|
  1081.  1   | Logical Unit Number      |                  Reserved                  |
  1082. -----|-----------------------------------------------------------------------|
  1083.  2   |                           Reserved                                    |
  1084. -----|-----------------------------------------------------------------------|
  1085.  3   |                           Reserved                                    |
  1086. -----|-----------------------------------------------------------------------|
  1087.  4   |                           Allocation Length                           |
  1088. -----|-----------------------------------------------------------------------|
  1089.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1090. ==============================================================================
  1091.  
  1092.   The MODE SENSE command (Table 8-18) provides a means for a target to report 
  1093. its medium, logical unit, or peripheral device parameters to the initiator.  
  1094. It is a complementary command to the MODE SELECT command for support of medium 
  1095. that may contain multiple block lengths or densities.
  1096.  
  1097.   The allocation length specifies the number of bytes that the initiator has 
  1098. allocated for returned MODE SENSE data.  An allocation length of zero 
  1099. indicates that no MODE SENSE data shall be transferred.  This condition shall 
  1100. not be considered as an error.  Any other value indicates the maximum number 
  1101. of bytes that shall be transferred.  The target shall terminate the DATA IN 
  1102. phase when allocation length bytes have been transferred or when all available 
  1103. MODE SENSE data have been transferred to the initiator, whichever is less.
  1104.  
  1105.   The MODE SENSE data (Table 8-19) contains a four-byte header, followed by 
  1106. zero or more eight-byte block descriptors, followed by the vendor unique 
  1107. parameters, if any. 
  1108. .pa
  1109.  
  1110.                                   Table 8-19
  1111.                                MODE SENSE Data
  1112.  
  1113. ==============================================================================
  1114.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1115. Byte |        |        |        |        |        |        |        |        |
  1116. ==============================================================================
  1117.  0   |                           Sense Data Length                           |
  1118. -----|-----------------------------------------------------------------------|
  1119.  1   |                           Medium Type                                 |
  1120. -----|-----------------------------------------------------------------------|
  1121.  2   |   WP   |                  Reserved                                    |
  1122. -----|-----------------------------------------------------------------------|
  1123.  3   |                           Block Descriptor Length                     |
  1124. ==============================================================================
  1125.      |                        Block Descriptor(s)                            |
  1126. ==============================================================================
  1127.  0   |                           Density Code                                |
  1128. -----|-----------------------------------------------------------------------|
  1129.  1   |                           Number of Blocks (MSB)                      |
  1130. -----|-----------------------------------------------------------------------|
  1131.  2   |                           Number of Blocks                            |
  1132. -----|-----------------------------------------------------------------------|
  1133.  3   |                           Number of Blocks (LSB)                      |
  1134. -----|-----------------------------------------------------------------------|
  1135.  4   |                           Reserved                                    |
  1136. -----|-----------------------------------------------------------------------|
  1137.  5   |                           Block Length (MSB)                          |
  1138. -----|-----------------------------------------------------------------------|
  1139.  6   |                           Block Length                                |
  1140. -----|-----------------------------------------------------------------------|
  1141.  7   |                           Block Length (LSB)                          |
  1142. ==============================================================================
  1143.      |                        Vendor Unique Parameter(s)                     |
  1144. ==============================================================================
  1145. 0 _ n|                           Vendor Unique                               |
  1146.      |                           Parameter Byte(s)                           |
  1147. ==============================================================================
  1148.  
  1149.   The sense data length specifies the length in bytes of the following MODE 
  1150. SENSE data that is available to be transferred during the DATA IN phase.  The 
  1151. sense data length does not include itself.
  1152.  
  1153.   Code values for the medium type field are defined in Table 8-14.1.
  1154.  
  1155.   A write protected (WP) bit of zero indicates that the medium is write 
  1156. enabled.  A WP bit of one indicates that the medium is write protected.
  1157.  
  1158.   The block descriptor length specifies the length in bytes of all the block 
  1159. descriptors.  It is equal to the number of block descriptors times eight and 
  1160. does not include the vendor unique parameters, if any.  A block descriptor 
  1161. length of zero indicates that no block descriptors shall be included in the 
  1162. parameter list.  This condition shall not be considered as an error.
  1163.  
  1164.   Each block descriptor specifies the medium characteristics for all or part 
  1165. of a logical unit.  Each block descriptor contains a density code, a number of 
  1166.  
  1167. blocks, and a block length.
  1168.  
  1169.   Code values for the density code field shall be assigned as follows:
  1170.  
  1171.   00H         Default (only one density supported)
  1172.   01H         Flexible disk, single density
  1173.   02H         Flexible disk, double density
  1174.   03H _ 7FH   Reserved
  1175.   80H _ FFH   Vendor unique
  1176.  
  1177.   The number of blocks field specifies the number of logical blocks of the 
  1178. medium that meets the density code and block length in the block descriptor.  
  1179. A number of blocks of zero indicates that all of the remaining logical blocks 
  1180. of the logical unit have the medium characteristics specified by the block 
  1181. descriptor.
  1182.  
  1183.   The block length specifies the length in bytes of each logical block.
  1184.  
  1185.   8.1.11 START/STOP UNIT Command
  1186.  
  1187.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1188.                               Read-Only Direct Access
  1189.         Operation Code Type:  Optional
  1190.              Operation Code:  1BH
  1191.  
  1192.                                   Table 8-20
  1193.                            START/STOP UNIT Command
  1194.  
  1195. ==============================================================================
  1196.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1197. Byte |        |        |        |        |        |        |        |        |
  1198. ==============================================================================
  1199.  0   |                           Operation Code                              | 
  1200. -----|-----------------------------------------------------------------------|
  1201.  1   | Logical Unit Number      |                  Reserved         | Immed  |
  1202. -----|-----------------------------------------------------------------------|
  1203.  2   |                           Reserved                                    |
  1204. -----|-----------------------------------------------------------------------|
  1205.  3   |                           Reserved                                    |
  1206. -----|-----------------------------------------------------------------------|
  1207.  4   |                           Reserved                           |  Start |
  1208. -----|-----------------------------------------------------------------------|
  1209.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1210. ==============================================================================
  1211.  
  1212.   The START/STOP UNIT command (Table 8-20) requests that the target enable or 
  1213. disable the logical unit for further operations.
  1214.  
  1215.   An immediate (Immed) bit of one indicates that status shall be returned as 
  1216. soon as the operation is initiated.  An Immed bit of zero indicates that 
  1217. status shall be returned after the operation is completed.
  1218.  
  1219.   A start bit of one requests the logical unit be made ready for use.  A start 
  1220. bit of zero requests that the logical unit be stopped.
  1221. .pa
  1222.  
  1223.   8.1.12 PREVENT/ALLOW MEDIUM REMOVAL Command
  1224.  
  1225.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1226.                               Read-Only Direct Access
  1227.         Operation Code Type:  Optional
  1228.              Operation Code:  1EH
  1229.  
  1230.                                   Table 8-21
  1231.                      PREVENT/ALLOW MEDIUM REMOVAL Command
  1232.  
  1233. ==============================================================================
  1234.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1235. Byte |        |        |        |        |        |        |        |        |
  1236. ==============================================================================
  1237.  0   |                           Operation Code                              | 
  1238. -----|-----------------------------------------------------------------------|
  1239.  1   | Logical Unit Number      |                  Reserved                  |
  1240. -----|-----------------------------------------------------------------------|
  1241.  2   |                           Reserved                                    |
  1242. -----|-----------------------------------------------------------------------|
  1243.  3   |                           Reserved                                    |
  1244. -----|-----------------------------------------------------------------------|
  1245.  4   |                           Reserved                           | Prevent|
  1246. -----|-----------------------------------------------------------------------|
  1247.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1248. ==============================================================================
  1249.  
  1250.   The PREVENT/ALLOW MEDIUM REMOVAL command (Table 8-21) requests that the 
  1251. target enable or disable the removal of the medium in the logical unit.
  1252.  
  1253.   A prevent bit of one shall inhibit mechanisms that normally allow removal of 
  1254. the medium.  A prevent bit of zero shall allow removal of the medium.
  1255.  
  1256.   This prevention of medium removal condition shall terminate upon receipt of 
  1257. a PREVENT/ALLOW MEDIUM REMOVAL command with the prevent bit set to zero, or by 
  1258. the receipt of a BUS DEVICE RESET message from any initiator or by a "hard" 
  1259. RESET condition.
  1260. .pa
  1261.  
  1262. 8.2 Group 1 Commands for Direct-Access Devices.  The Group 1 commands for 
  1263. direct-access devices shall be as shown in Table 8-22.
  1264.  
  1265.                                   Table 8-22
  1266.                   Group 1 Commands for Direct-Access Devices
  1267.  
  1268. ==============================================================================
  1269. Operation
  1270.   Code      Type   Command Name                       Section
  1271. ------------------------------------------------------------------------------
  1272.    20H       V
  1273.    21H       V
  1274.    22H       V
  1275.    23H       V
  1276.    24H       V
  1277.    25H       E     READ CAPACITY                      8.2.1
  1278.    26H       V
  1279.    27H       V
  1280.    28H       E     READ                               8.2.2
  1281.    29H       V
  1282.    2AH       E     WRITE                              8.2.3
  1283.    2BH       O     SEEK                               8.2.4
  1284.    2CH       V
  1285.    2DH       V
  1286.    2EH       O     WRITE AND VERIFY                   8.2.5
  1287.    2FH       O     VERIFY                             8.2.6
  1288.    30H       O     SEARCH DATA HIGH                   8.2.7.1
  1289.    31H       O     SEARCH DATA EQUAL                  8.2.7.2
  1290.    32H       O     SEARCH DATA LOW                    8.2.7.3
  1291.    33H       O     SET LIMITS                         8.2.8
  1292.    34H       R
  1293.    35H       R
  1294.    36H       R
  1295.    37H       R
  1296.    38H       R
  1297.    39H       O     COMPARE                            7.2.1
  1298.    3AH       O     COPY AND VERIFY                    7.2.2
  1299.    3BH       R
  1300.    3CH       R
  1301.    3DH       R
  1302.    3EH       R
  1303.    3FH       R
  1304. ==============================================================================
  1305.  
  1306. Key: M  =  Command implementation is mandatory.
  1307.      E  =  Command implementation is required for SCSI devices that support 
  1308.            device-independent self-configuring software.
  1309.      O  =  Command implementation is optional.
  1310.      R  =  Operation code is reserved for future standardization.
  1311.      V  =  Operation code is available for vendor unique commands.
  1312. .pa
  1313.  
  1314.   8.2.1 READ CAPACITY Command
  1315.  
  1316.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1317.                               Read-Only Direct Access
  1318.         Operation Code Type:  Extended
  1319.              Operation Code:  25H
  1320.  
  1321.                                   Table 8-23
  1322.                             READ CAPACITY Command
  1323.  
  1324. ==============================================================================
  1325.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1326. Byte |        |        |        |        |        |        |        |        |
  1327. ==============================================================================
  1328.  0   |                           Operation Code                              | 
  1329. -----|-----------------------------------------------------------------------|
  1330.  1   | Logical Unit Number      |             Reserved              | RelAdr |
  1331. -----|-----------------------------------------------------------------------|
  1332.  2   |                           Logical Block Address (MSB)                 |
  1333. -----|-----------------------------------------------------------------------|
  1334.  3   |                           Logical Block Address                       |
  1335. -----|-----------------------------------------------------------------------|
  1336.  4   |                           Logical Block Address                       |
  1337. -----|-----------------------------------------------------------------------|
  1338.  5   |                           Logical Block Address (LSB)                 |
  1339. -----|-----------------------------------------------------------------------|
  1340.  6   |                           Reserved                                    |
  1341. -----|-----------------------------------------------------------------------|
  1342.  7   |                           Reserved                                    |
  1343. -----|-----------------------------------------------------------------------|
  1344.  8   | Vendor Unique   |         Reserved                           |  PMI   |
  1345. -----|-----------------------------------------------------------------------|
  1346.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1347. ==============================================================================
  1348.  
  1349.   The READ CAPACITY command (Table 8-23) provides a means for the initiator to 
  1350. request information regarding the capacity of the logical unit.
  1351.  
  1352.   A partial medium indicator (PMI) bit of zero indicates that the information 
  1353. returned in the READ CAPACITY data shall be the logical block address and 
  1354. block length (in bytes) of the last logical block of the logical unit.  The 
  1355. logical block address in the command descriptor block shall be to set zero for 
  1356. this option.
  1357.  
  1358.   A PMI bit of one indicates that the information returned shall be the 
  1359. logical block address and block length (in bytes) of the last logical block 
  1360. address after which a substantial delay in data transfer will be encountered.  
  1361. This logical block address shall be greater than or equal to the logical block 
  1362. address specified in the command descriptor block.  (Implementors note:  This 
  1363. function is intended to assist storage management software in determining 
  1364. whether there is sufficient space on the current track, cylinder, etc. to 
  1365. contain a frequently accessed data structure such as a file directory or file 
  1366. index.)
  1367.  
  1368.   The eight bytes of READ CAPACITY data shown in Table 8-24 shall be sent 
  1369. during the DATA IN phase of the command.
  1370.  
  1371.                                   Table 8-24
  1372.                               READ CAPACITY Data
  1373.  
  1374. ==============================================================================
  1375. Byte |                        Description                                    |
  1376. ==============================================================================
  1377.  0   |                           Logical Block Address (MSB)                 |
  1378. -----|-----------------------------------------------------------------------|
  1379.  1   |                           Logical Block Address                       |
  1380. -----|-----------------------------------------------------------------------|
  1381.  2   |                           Logical Block Address                       |
  1382. -----|-----------------------------------------------------------------------|
  1383.  3   |                           Logical Block Address (LSB)                 |
  1384. -----|-----------------------------------------------------------------------|
  1385.  4   |                           Block Length (MSB)                          |
  1386. -----|-----------------------------------------------------------------------|
  1387.  5   |                           Block Length                                |
  1388. -----|-----------------------------------------------------------------------|
  1389.  6   |                           Block Length                                |
  1390. -----|-----------------------------------------------------------------------|
  1391.  7   |                           Block Length (LSB)                          |
  1392. ==============================================================================
  1393.  
  1394.   8.2.2 READ Command
  1395.  
  1396.      Peripheral Device Type:  Direct Access
  1397.         Operation Code Type:  Extended
  1398.              Operation Code:  28H
  1399.  
  1400.                                   Table 8-25
  1401.                                  READ Command
  1402.  
  1403. ==============================================================================
  1404.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1405. Byte |        |        |        |        |        |        |        |        |
  1406. ==============================================================================
  1407.  0   |                           Operation Code                              | 
  1408. -----|-----------------------------------------------------------------------|
  1409.  1   | Logical Unit Number      |             Reserved              | RelAdr |
  1410. -----|-----------------------------------------------------------------------|
  1411.  2   |                           Logical Block Address (MSB)                 |
  1412. -----|-----------------------------------------------------------------------|
  1413.  3   |                           Logical Block Address                       |
  1414. -----|-----------------------------------------------------------------------|
  1415.  4   |                           Logical Block Address                       |
  1416. -----|-----------------------------------------------------------------------|
  1417.  5   |                           Logical Block Address (LSB)                 |
  1418. -----|-----------------------------------------------------------------------|
  1419.  6   |                           Reserved                                    |
  1420. -----|-----------------------------------------------------------------------|
  1421.  7   |                           Transfer Length (MSB)                       |
  1422. -----|-----------------------------------------------------------------------|
  1423.  8   |                           Transfer Length (LSB)                       |
  1424. -----|-----------------------------------------------------------------------|
  1425.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1426. ==============================================================================
  1427.  
  1428.   The READ command (Table 8-25) requests that the target transfer data to the 
  1429. initiator.
  1430.  
  1431.   The logical block address specifies the logical block at which the read 
  1432. operation shall begin.
  1433.  
  1434.   The transfer length specifies the number of contiguous logical blocks of 
  1435. data that shall be transferred.  A transfer length of zero indicates that no 
  1436. logical blocks shall be transferred.  This condition shall not be considered 
  1437. as an error.  Any other value indicates the number of logical blocks that 
  1438. shall be transferred.
  1439.  
  1440.   The most recent data value written in the addressed logical block shall be 
  1441. returned.
  1442.  
  1443.   This command shall be terminated with a RESERVATION CONFLICT status if any 
  1444. reservation access conflict (see 8.1.8) exists and no data shall be read.
  1445.  
  1446.   If any of the following conditions occur, this command shall return a CHECK 
  1447. CONDITION status and the sense key shall be set as indicated in the following 
  1448. table.  This table does not provide an exhaustive enumeration of all 
  1449. conditions that may cause the CHECK CONDITION status.
  1450.  
  1451.  
  1452. Condition                                         Sense Key
  1453. ----------------------------------------------    ----------------------------
  1454. Invalid logical block address                     ILLEGAL REQUEST (see note)
  1455.  
  1456. Target reset or medium change
  1457. since last command from this initiator            UNIT ATTENTION
  1458.  
  1459. Unrecovered read error                            MEDIUM ERROR
  1460.  
  1461. Recoverable read error                            RECOVERED ERROR
  1462.  
  1463. Overrun or other error that might
  1464. be resolved by repeating the command              ABORTED COMMAND
  1465.  
  1466.  
  1467. NOTE:  The extended sense information bytes shall be set to the logical block 
  1468. address of the first invalid address. 
  1469. .pa
  1470.  
  1471.   8.2.3 WRITE Command
  1472.  
  1473.      Peripheral Device Type:  Direct Access
  1474.         Operation Code Type:  Extended
  1475.              Operation Code:  2AH
  1476.  
  1477.                                   Table 8-26
  1478.                                 WRITE Command
  1479.  
  1480. ==============================================================================
  1481.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1482. Byte |        |        |        |        |        |        |        |        |
  1483. ==============================================================================
  1484.  0   |                           Operation Code                              | 
  1485. -----|-----------------------------------------------------------------------|
  1486.  1   | Logical Unit Number      |             Reserved              | RelAdr |
  1487. -----|-----------------------------------------------------------------------|
  1488.  2   |                           Logical Block Address (MSB)                 |
  1489. -----|-----------------------------------------------------------------------|
  1490.  3   |                           Logical Block Address                       |
  1491. -----|-----------------------------------------------------------------------|
  1492.  4   |                           Logical Block Address                       |
  1493. -----|-----------------------------------------------------------------------|
  1494.  5   |                           Logical Block Address (LSB)                 |
  1495. -----|-----------------------------------------------------------------------|
  1496.  6   |                           Reserved                                    |
  1497. -----|-----------------------------------------------------------------------|
  1498.  7   |                           Transfer Length (MSB)                       |
  1499. -----|-----------------------------------------------------------------------|
  1500.  8   |                           Transfer Length (LSB)                       |
  1501. -----|-----------------------------------------------------------------------|
  1502.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1503. ==============================================================================
  1504.  
  1505.   The WRITE command (Table 8-26) requests that the target write the data 
  1506. transferred by the initiator to the medium.
  1507.  
  1508.   The logical block address specifies the logical block at which the write 
  1509. operation shall begin.
  1510.  
  1511.   The transfer length specifies the number of contiguous logical blocks of 
  1512. data that shall be transferred.  A transfer length of zero indicates that no 
  1513. logical blocks shall be transferred.  This condition shall not be considered 
  1514. as an error and no data shall be written.  Any other value indicates the 
  1515. number of logical blocks that shall be transferred.
  1516.  
  1517.   This command shall be terminated with a RESERVATION CONFLICT status if any 
  1518. reservation access conflict (see 8.1.8) exists and no data shall be written.
  1519.  
  1520.   If any of the following conditions occur, this command shall be terminated 
  1521. with a CHECK CONDITION status and the sense key shall be set as indicated in 
  1522. the following table.  This table does not provide an exhaustive enumeration of 
  1523. all conditions that may cause the CHECK CONDITION status.
  1524. .pa
  1525.  
  1526. Condition                                         Sense Key
  1527. ----------------------------------------------    ----------------------------
  1528. Invalid logical block address                     ILLEGAL REQUEST (see note)
  1529.  
  1530. Target reset or medium change since the
  1531. last command from this initiator                  UNIT ATTENTION
  1532.  
  1533. Overrun or other error that might
  1534. be resolved by repeating the command              ABORTED COMMAND
  1535.  
  1536. NOTE:  The extended sense information bytes shall be set to the logical block 
  1537. address of the first invalid address.  In this case,  no data shall be 
  1538. written on the logical unit. 
  1539.  
  1540.   8.2.4 SEEK Command
  1541.  
  1542.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1543.                               Read-Only Direct Access
  1544.         Operation Code Type:  Optional
  1545.              Operation Code:  2BH
  1546.  
  1547.                                   Table 8-27
  1548.                                  SEEK Command
  1549.  
  1550. ==============================================================================
  1551.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1552. Byte |        |        |        |        |        |        |        |        |
  1553. ==============================================================================
  1554.  0   |                           Operation Code                              | 
  1555. -----|-----------------------------------------------------------------------|
  1556.  1   | Logical Unit Number      |                  Reserved                  |
  1557. -----|-----------------------------------------------------------------------|
  1558.  2   |                           Logical Block Address (MSB)                 |
  1559. -----|-----------------------------------------------------------------------|
  1560.  3   |                           Logical Block Address                       |
  1561. -----|-----------------------------------------------------------------------|
  1562.  4   |                           Logical Block Address                       |
  1563. -----|-----------------------------------------------------------------------|
  1564.  5   |                           Logical Block Address (LSB)                 |
  1565. -----|-----------------------------------------------------------------------|
  1566.  6   |                           Reserved                                    |
  1567. -----|-----------------------------------------------------------------------|
  1568.  7   |                           Reserved                                    |
  1569. -----|-----------------------------------------------------------------------|
  1570.  8   |                           Reserved                                    |
  1571. -----|-----------------------------------------------------------------------|
  1572.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1573. ==============================================================================
  1574.  
  1575.   The SEEK command (Table 8-27) requests that the logical unit seek to the 
  1576. specified logical block address.
  1577. .pa
  1578.  
  1579.   8.2.5 WRITE AND VERIFY Command
  1580.  
  1581.      Peripheral Device Type:  Direct Access
  1582.         Operation Code Type:  Optional
  1583.              Operation Code:  2EH
  1584.  
  1585.                                   Table 8-28
  1586.                            WRITE AND VERIFY Command
  1587.  
  1588. ==============================================================================
  1589.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1590. Byte |        |        |        |        |        |        |        |        |
  1591. ==============================================================================
  1592.  0   |                           Operation Code                              | 
  1593. -----|-----------------------------------------------------------------------|
  1594.  1   | Logical Unit Number      |             Reserved     | BytChk | RelAdr |
  1595. -----|-----------------------------------------------------------------------|
  1596.  2   |                           Logical Block Address (MSB)                 |
  1597. -----|-----------------------------------------------------------------------|
  1598.  3   |                           Logical Block Address                       |
  1599. -----|-----------------------------------------------------------------------|
  1600.  4   |                           Logical Block Address                       |
  1601. -----|-----------------------------------------------------------------------|
  1602.  5   |                           Logical Block Address (LSB)                 |
  1603. -----|-----------------------------------------------------------------------|
  1604.  6   |                           Reserved                                    |
  1605. -----|-----------------------------------------------------------------------|
  1606.  7   |                           Transfer Length (MSB)                       |
  1607. -----|-----------------------------------------------------------------------|
  1608.  8   |                           Transfer Length (LSB)                       |
  1609. -----|-----------------------------------------------------------------------|
  1610.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1611. ==============================================================================
  1612.  
  1613.   The WRITE AND VERIFY command (Table 8-28) requests that the target write the 
  1614. data transferred from the initiator to the medium and then verify that the 
  1615. data is correctly written.
  1616.  
  1617.   A byte check (BytChk) bit of zero causes the verification to be simply a 
  1618. medium verification (CRC, ECC, etc).  A BytChk bit of one causes a byte-by-
  1619. byte compare of data written on the peripheral device and the data transferred 
  1620. >From the initiator.  If the compare is unsuccessful, the command shall be 
  1621. terminated with a CHECK CONDITION status and the sense key shall be set to 
  1622. MISCOMPARE.
  1623.  
  1624.   The logical block address specifies the logical block at which the write 
  1625. operation shall begin.
  1626.  
  1627.   The transfer length specifies the number of contiguous logical blocks of 
  1628. data that shall be transferred.  A transfer length of zero indicates that no 
  1629. logical blocks shall be transferred.  This condition shall not be considered 
  1630. as an error and no data shall be written.  Any other value indicates the 
  1631. number of logical blocks that shall be transferred.
  1632. .pa
  1633.  
  1634.   8.2.6 VERIFY Command
  1635.  
  1636.      Peripheral Device Type:  Direct Access
  1637.         Operation Code Type:  Optional
  1638.              Operation Code:  2FH
  1639.  
  1640.                                   Table 8-29
  1641.                                 VERIFY Command
  1642.  
  1643. ==============================================================================
  1644.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1645. Byte |        |        |        |        |        |        |        |        |
  1646. ==============================================================================
  1647.  0   |                           Operation Code                              | 
  1648. -----|-----------------------------------------------------------------------|
  1649.  1   | Logical Unit Number      |         Reserved         | BytChk | RelAdr |
  1650. -----|-----------------------------------------------------------------------|
  1651.  2   |                           Logical Block Address (MSB)                 |
  1652. -----|-----------------------------------------------------------------------|
  1653.  3   |                           Logical Block Address                       |
  1654. -----|-----------------------------------------------------------------------|
  1655.  4   |                           Logical Block Address                       |
  1656. -----|-----------------------------------------------------------------------|
  1657.  5   |                           Logical Block Address (LSB)                 |
  1658. -----|-----------------------------------------------------------------------|
  1659.  6   |                           Reserved                                    |
  1660. -----|-----------------------------------------------------------------------|
  1661.  7   |                           Verification Length (MSB)                   |
  1662. -----|-----------------------------------------------------------------------|
  1663.  8   |                           Verification Length (LSB)                   |
  1664. -----|-----------------------------------------------------------------------|
  1665.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1666. ==============================================================================
  1667.  
  1668.   The VERIFY command (Table 8-29) requests that the target verify the data 
  1669. written on the medium.
  1670.  
  1671.   A byte check (BytChk) bit of zero causes the verification to be simply a 
  1672. medium verification (CRC, ECC, etc).  A BytChk bit of one causes a byte-by-
  1673. byte compare of data on the medium and the data transferred from the 
  1674. initiator.  If the compare is unsuccessful, the command shall be terminated 
  1675. with a CHECK CONDITION status and the sense key shall be set to MISCOMPARE.
  1676.  
  1677.   The logical block address specifies the logical block at which the verify 
  1678. operation shall begin.
  1679.  
  1680.   The verification length specifies the number of contiguous logical blocks of 
  1681. data that shall be verified.  A transfer length of zero indicates that no 
  1682. logical blocks shall be verified.  This condition shall not be considered as 
  1683. an error.  Any other value indicates the number of logical blocks that shall 
  1684. be verified.
  1685. .pa
  1686.  
  1687.   8.2.7 SEARCH DATA Commands
  1688.  
  1689.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1690.                               Read-Only Direct Access
  1691.         Operation Code Type:  Optional
  1692.              Operation Code:  30H, 31H, or 32H
  1693.  
  1694.                                   Table 8-30
  1695.                              SEARCH DATA Commands
  1696.  
  1697. ==============================================================================
  1698.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1699. Byte |        |        |        |        |        |        |        |        |
  1700. ==============================================================================
  1701.  0   |                           Operation Code                              | 
  1702. -----|-----------------------------------------------------------------------|
  1703.  1   | Logical Unit Number      | Invert |     Reserved    | SpnDat | RelAdr |
  1704. -----|-----------------------------------------------------------------------|
  1705.  2   |                           Logical Block Address (MSB)                 |
  1706. -----|-----------------------------------------------------------------------|
  1707.  3   |                           Logical Block Address                       |
  1708. -----|-----------------------------------------------------------------------|
  1709.  4   |                           Logical Block Address                       |
  1710. -----|-----------------------------------------------------------------------|
  1711.  5   |                           Logical Block Address (LSB)                 |
  1712. -----|-----------------------------------------------------------------------|
  1713.  6   |                           Reserved                                    |
  1714. -----|-----------------------------------------------------------------------|
  1715.  7   |                           Transfer Length (MSB)                       |
  1716. -----|-----------------------------------------------------------------------|
  1717.  8   |                           Transfer Length (LSB)                       |
  1718. -----|-----------------------------------------------------------------------|
  1719.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1720. ==============================================================================
  1721.  
  1722.   The SEARCH DATA commands (Table 8-30) search one or more logical blocks for 
  1723. equality or inequality to a data pattern.  The concept of records within a 
  1724. logical block is used to allow multiple records within a logical block to be 
  1725. searched.
  1726.  
  1727.   The invert bit determines whether the search condition is to be inverted.  
  1728. See 8.2.7.1 through 8.2.7.3 for a description of the search conditions for the 
  1729. individual SEARCH DATA commands.
  1730.  
  1731.   A spanned data (SpnDat) bit of zero indicates that each record shall be 
  1732. wholly contained within a single block.  Any space at the end of a block that 
  1733. is smaller than the record length is ignored by the SEARCH DATA commands.   A 
  1734. SpnDat bit of one indicates that records span block boundaries.  Thus, a 
  1735. record may start in one block and end in the next or a subsequent block.
  1736.  
  1737.   A transfer length of zero indicates that no data shall be searched.  This 
  1738. condition shall be treated the same as an unsatisfied search. 
  1739.  
  1740.   A link bit of zero indicates a nonlinked command and if the search is 
  1741. satisfied, the command shall be terminated with a CONDITION MET status.  A 
  1742. REQUEST SENSE command can then be issued to determine the logical block 
  1743.  
  1744. address and record offset of the matching record.  If the search is not 
  1745. satisfied and no error occurs, the command shall be terminated with GOOD 
  1746. status.
  1747.  
  1748.   A link bit of one indicates a command is linked to the SEARCH DATA command 
  1749. and if the search is satisfied, CONDITION MET status is returned and the next 
  1750. command is executed.  If the RelAdr bit in the next command is one, the 
  1751. logical block address of the next command is used as a displacement from the 
  1752. logical block address at which the search was satisfied.  If a linked search 
  1753. is not satisfied, the command is terminated with a CHECK CONDITION status.  A 
  1754. REQUEST SENSE command may then be issued.
  1755.  
  1756.   A REQUEST SENSE command following a satisfied SEARCH DATA command shall:
  1757.  
  1758.   (1) Return a sense key of EQUAL if the search was satisfied by an exact 
  1759. match.  If the search was satisfied by an inequality then a sense key of NO 
  1760. SENSE shall be returned.
  1761.  
  1762.   (2) Return the valid bit set to one.
  1763.  
  1764.   (3) Return the logical block address of the logical block containing the 
  1765. first matching record in the information bytes.
  1766.  
  1767.   (4) Return the record offset of the matching record in the first four bytes 
  1768. of additional sense bytes.
  1769.  
  1770.   A REQUEST SENSE command following an unsatisfied SEARCH DATA command shall:
  1771.  
  1772.   (1) Return a sense key of NO SENSE, if no errors occurred during the command 
  1773. execution.
  1774.  
  1775.   (2) Return the valid bit set to zero.
  1776.  
  1777.   The SEARCH DATA parameter list (Table 8-31) contains a fourteen-byte header, 
  1778. followed by one or more search argument descriptors. 
  1779. .pa
  1780.  
  1781.                                   Table 8-31
  1782.                           SEARCH DATA Parameter List
  1783.  
  1784. ==============================================================================
  1785. Byte |                        Parameter List Header                          |
  1786. ==============================================================================
  1787.  0   |                           Logical Record Length (MSB)                 |
  1788. -----|-----------------------------------------------------------------------|
  1789.  1   |                           Logical Record Length                       |
  1790. -----|-----------------------------------------------------------------------|
  1791.  2   |                           Logical Record Length                       |
  1792. -----|-----------------------------------------------------------------------|
  1793.  3   |                           Logical Record Length (LSB)                 |
  1794. -----|-----------------------------------------------------------------------|
  1795.  4   |                           First Record Offset (MSB)                   |
  1796. -----|-----------------------------------------------------------------------|
  1797.  5   |                           First Record Offset                         |
  1798. -----|-----------------------------------------------------------------------|
  1799.  6   |                           First Record Offset                         |
  1800. -----|-----------------------------------------------------------------------|
  1801.  7   |                           First Record Offset (LSB)                   |
  1802. -----|-----------------------------------------------------------------------|
  1803.  8   |                           Number of Records (MSB)                     |
  1804. -----|-----------------------------------------------------------------------|
  1805.  9   |                           Number of Records                           |
  1806. -----|-----------------------------------------------------------------------|
  1807. 10   |                           Number of Records                           |
  1808. -----|-----------------------------------------------------------------------|
  1809. 11   |                           Number of Records (LSB)                     |
  1810. -----|-----------------------------------------------------------------------|
  1811. 12   |                           Search Argument Length (MSB)                |
  1812. -----|-----------------------------------------------------------------------|
  1813. 13   |                           Search Argument Length (LSB)                |
  1814. ==============================================================================
  1815.      |                        Search Argument Descriptor(s)                  |
  1816. ==============================================================================
  1817.  0   |                           Displacement (MSB)                          |
  1818. -----|-----------------------------------------------------------------------|
  1819.  1   |                           Displacement                                |
  1820. -----|-----------------------------------------------------------------------|
  1821.  2   |                           Displacement                                |
  1822. -----|-----------------------------------------------------------------------|
  1823.  3   |                           Displacement (LSB)                          |
  1824. -----|-----------------------------------------------------------------------|
  1825.  4   |                           Pattern Length (MSB)                        |
  1826. -----|-----------------------------------------------------------------------|
  1827.  5   |                           Pattern Length (LSB)                        |
  1828. -----|-----------------------------------------------------------------------|
  1829. 6 _ n|                           Pattern                                     |
  1830. ==============================================================================
  1831.  
  1832.   The logical record length field specifies the record length in bytes.
  1833.  
  1834.   The first record offset field specifies the number of bytes that shall be 
  1835. ignored in the first logical block before the search begins.  The value in the 
  1836. first record offset field shall not exceed the length of the logical block.  
  1837.  
  1838. Subsequent logical blocks shall be searched beginning with the first byte in 
  1839. the logical block.  This permits one or more records to be skipped initially.
  1840.  
  1841.   The number of records field specifies the maximum number of records that 
  1842. shall be searched by this command.  An unsatisfied search shall terminate when 
  1843. the number of records or the number of blocks (from the command descriptor 
  1844. block) have been exhausted.
  1845.  
  1846.   The search argument length specifies the length in bytes of all the search 
  1847. argument descriptors that follow.  Since the pattern length can vary, there is 
  1848. no fixed multiple of the search argument descriptor to determine the search 
  1849. argument length.
  1850.  
  1851.   The search argument descriptors specify one or more search conditions to 
  1852. execute within a single record in order to satisfy the search.  Each search 
  1853. argument descriptor is made up of a displacement, a pattern length, and a 
  1854. pattern.
  1855.  
  1856.   The displacement field specifies the displacement in bytes of the first byte 
  1857. of the data to be compared from the start of the logical record.
  1858.  
  1859.   The pattern length field specifies the length in bytes of the pattern that 
  1860. follows.
  1861.  
  1862.   The pattern specifies the data to compare to the logical record.
  1863.  
  1864.      8.2.7.1 SEARCH DATA HIGH Command.  The SEARCH DATA HIGH command 
  1865. (Table 8-30, operation code 30H) shall be satisfied by the first logical 
  1866. record searched that contains data that satisfies all of the search argument 
  1867. descriptor(s).  If the invert bit in the command descriptor block is zero, the 
  1868. search argument descriptor(s) shall be satisfied by data in the logical record 
  1869. being greater than the data in the pattern.  If the invert bit is one, the 
  1870. search argument descriptor(s) shall be satisfied by data in the logical record 
  1871. being less than or equal to the data in the pattern.  (See 8.2.7.)
  1872.  
  1873.      8.2.7.2 SEARCH DATA EQUAL Command.  The SEARCH DATA EQUAL command 
  1874. (Table8-30, operation code 31H) shall be satisfied by the first logical 
  1875. record searched that contains data that satisfies all of the search argument 
  1876. descriptor(s).  If the invert bit in the command descriptor block is zero, the 
  1877. search argument descriptor(s) shall be satisfied by data in the logical record 
  1878. being equal to the data in the pattern.  If the invert bit is one, the search 
  1879. argument descriptor(s) shall be satisfied by data in the logical record being 
  1880. not equal to the data in the pattern.  (See 8.2.7.)
  1881.  
  1882.      8.2.7.3 SEARCH DATA LOW Command.  The SEARCH DATA LOW command 
  1883. (Table 8-30, operation code 32H) shall be satisfied by the first logical 
  1884. record searched that contains data that satisfies all of the search argument 
  1885. descriptor(s).  If the invert bit in the command descriptor block is zero, the 
  1886. search argument descriptor(s) shall be satisfied by data in the logical record 
  1887. being less than the data in the pattern.  If the invert bit is one, the search 
  1888. argument descriptor(s) shall be satisfied by data in the logical record being 
  1889. greater than or equal to the data in the pattern.  (See 8.2.7.)
  1890. .pa
  1891.  
  1892.  8.2.8 SET LIMITS Command
  1893.  
  1894.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1895.                               Read-Only Direct Access
  1896.         Operation Code Type:  Optional
  1897.              Operation Code:  33H
  1898.  
  1899.                                   Table 8-32
  1900.                               SET LIMITS Command
  1901.  
  1902. ==============================================================================
  1903.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1904. Byte |        |        |        |        |        |        |        |        |
  1905. ==============================================================================
  1906.  0   |                           Operation Code                              | 
  1907. -----|-----------------------------------------------------------------------|
  1908.  1   | Logical Unit Number      |         Reserved         | RdInh  | WrInh  |
  1909. -----|-----------------------------------------------------------------------|
  1910.  2   |                           Logical Block Address (MSB)                 |
  1911. -----|-----------------------------------------------------------------------|
  1912.  3   |                           Logical Block Address                       |
  1913. -----|-----------------------------------------------------------------------|
  1914.  4   |                           Logical Block Address                       |
  1915. -----|-----------------------------------------------------------------------|
  1916.  5   |                           Logical Block Address (LSB)                 |
  1917. -----|-----------------------------------------------------------------------|
  1918.  6   |                           Reserved                                    |
  1919. -----|-----------------------------------------------------------------------|
  1920.  7   |                           Number of Blocks (MSB)                      |
  1921. -----|-----------------------------------------------------------------------|
  1922.  8   |                           Number of Blocks (LSB)                      |
  1923. -----|-----------------------------------------------------------------------|
  1924.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1925. ==============================================================================
  1926.  
  1927.   The SET LIMITS command (Table 8-32) defines the range within which 
  1928. subsequent linked commands may operate.  A second SET LIMITS command may not 
  1929. be linked to a chain of commands in which a SET LIMITS command has already 
  1930. been issued.
  1931.  
  1932.   A read inhibit (RdInh) bit of one indicates that read operations within the 
  1933. range are inhibited.  A write inhibit (WrInh) bit of one indicates that write 
  1934. operations within the range are inhibited.
  1935.  
  1936.   The logical block address specifies the starting address for the range.  The 
  1937. number of blocks specifies the number of logical blocks within the range.  A 
  1938. number of blocks of zero indicates that the range shall extend to the last 
  1939. logical block on the logical unit.
  1940.  
  1941.   Any attempt to access outside of the restricted range or any attempt to 
  1942. perform an inhibited operation within the restricted range shall not be 
  1943. performed.  The command shall be terminated with CHECK CONDITION status and, 
  1944. if extended sense is implemented, the sense key shall be set to DATA PROTECT.  
  1945. A second SET LIMITS command within a linked list of commands shall be rejected 
  1946. with CHECK CONDITION status and, if extended sense is implemented, the sense 
  1947. key shall be set to DATA PROTECT.
  1948.  
  1949. 
  1950.  
  1951.